<!--{include(pe_tpl('header.html'));}-->
<div class="right_page">
	<div class="now">
		<a href="admin.php?mod=sign" <!--{if($act=='index'):}-->class="sel"<!--{endif;}-->>签到设置<i></i></a>
		<a href="admin.php?mod=sign&act=list" <!--{if($act=='list'):}-->class="sel"<!--{endif;}-->>签到记录（{$tongji['all']}）<i></i></a>
		<div class="clear"></div>
	</div>
	<form method="post" id="form">
	<div class="right_main">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="wenzhang mat20 mab20">
		<tr>
			<td align="right" width="200">启用状态：</td>
			<td>
				<div class="layui-form">
					<input type="checkbox" name="sign_state" value="1" <!--{if($info['sign_state']['value']):}-->checked<!--{endif;}--> lay-skin="switch" lay-text="开启|关闭" />
				</div>
			</td>
		</tr>
		<tr>
			<td align="right">活动说明：</td>
			<td><textarea name="sign_text" id="editortext" style="width:800px;height:220px">{$info['sign_text']['value']}</textarea></td>
		</tr>
		</table>
	</div>
	<div class="now"><a href="javascript:;" class="sel">奖励设置<i></i></a></div>
	<div class="right_main">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="wenzhang mat20 mab20">
		<tr>
			<td align="right" width="200">日常签到：</td>
			<td><input type="text" name="sign_point" value="{$info['sign_point']['value']}" class="inputall input100" /> 积分</td>
		</tr>
		<tr>
			<td align="right">首次签到：</td>
			<td><input type="text" name="sign_point_shouci" value="{$info['sign_point_shouci']['value']}" class="inputall input100" /> 积分</td>
		</tr>
		<tr>
			<td align="right">连续签到：</td>
			<td>
				<table width="100%" class="list_border" id="lianxu_table" style="width:600px;">
				<tr>
					<th class="bgtt" width="220">签到天数</th>
					<th class="bgtt" width="220">奖励积分</th>
					<th class="bgtt">操作</th>
				</tr>
				<!--{foreach($lianxu_list as $v):}-->
				<tr>
					<td><input type="text" name="lx_day[]" value="{$v['day']}" class="inputtext input100" /></td>
					<td><input type="text" name="lx_point[]" value="{$v['point']}" class="inputtext input100" /></td>
					<td><a href="javascript:;" onclick="del_rule(this);" class="admin_btn">删除</a></td>
				</tr>
				<!--{endforeach;}-->
				<tr>
					<td colspan="3"><a href="javascript:add_rule('lianxu');" class="cblue js_addbtn">+ 新增本月连续签到奖励</a></td>
				</tr>
				</table>	
			</td>
		</tr>
		<tr>
			<td align="right">累计签到：</td>
			<td>
				<table width="100%" class="list_border" id="leiji_table" style="width:600px;">
				<tr>
					<th width="220">签到天数</th>
					<th width="220">奖励积分</th>
					<th>操作</th>
				</tr>
				<!--{foreach($leiji_list as $v):}-->
				<tr>
					<td><input type="text" name="lj_day[]" value="{$v['day']}" class="inputtext input100" /></td>
					<td><input type="text" name="lj_point[]" value="{$v['point']}" class="inputtext input100" /></td>
					<td><a href="javascript:;" onclick="del_rule(this);" class="admin_btn">删除</a></td>
				</tr>
				<!--{endforeach;}-->
				<tr>
					<td colspan="3"><a href="javascript:add_rule('leiji');" class="cblue">+ 新增本月累计签到奖励</a></td>
				</tr>
				</table>	
			</td>
		</tr>
		</table>
	</div>
	<div class="right_bottom center">
		<input type="hidden" name="pe_token" value="{$pe_token}" />
		<input type="hidden" name="pesubmit" value="{$pe_token}" />
		<input type="button" value="提 交" class="tjbtn">
	</div>
	</form>
</div>
<script type="text/html" id="lianxu_tpl">
<tr>
	<td><input type="text" name="lx_day[]" value="" class="inputtext input100" /></td>
	<td><input type="text" name="lx_point[]" value="" class="inputtext input100" /></td>
	<td><a href="javascript:;" onclick="del_rule(this);" class="admin_btn">删除</a></td>
</tr>
</script>
<script type="text/html" id="leiji_tpl">
<tr>
	<td><input type="text" name="lj_day[]" value="" class="inputtext input100" /></td>
	<td><input type="text" name="lj_point[]" value="" class="inputtext input100" /></td>
	<td><a href="javascript:;" onclick="del_rule(this);" class="admin_btn">删除</a></td>
</tr>
</script>
<link rel="stylesheet" href="{$pe['host']}include/plugin/layui/css/layui.css">
<script src="{$pe['host']}include/plugin/layui/layui.js"></script>
<script type="text/javascript" src="{$pe['host']}include/plugin/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="{$pe['host']}include/plugin/ueditor/ueditor.api.js"></script>
<script type="text/javascript">
$(function(){
	$(":button").click(function(){
		pe_submit("{pe_nowurl()}", function(json){
			if (json.code == 1) pe_open('reload', 1000);
		});
	})
})
UE.getEditor('editortext');
layui.use(['form'], function(){
	form = layui.form;
});
function add_rule(type) {
	$("#"+type+"_table tr:last").before($("#"+type+"_tpl").html());
};
function del_rule(_this) {
	$(_this).parents("tr:eq(0)").remove();
}
</script>
<!--{include(pe_tpl('footer.html'));}-->